import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userinfo:JSON.parse(localStorage.getItem('temp'))||{},
    // list:{}
  },
  mutations: {
      setUser (state, value) {
          state.userinfo = value;
          // state.list=value;
          localStorage.setItem('temp', JSON.stringify(value))
      }
  },
  actions: {
    action1({commit},value){
      commit('setUser',value)
    }
  },
  modules: {
  }
})
